import { TeamUser } from "@/type/team"
import { isCodeMessage } from "../config"

/**
 * @author: 小佘佘🦀
 * @description: 发送邀请加入团队
 * @param {TeamUser} teamUser
 * */
export const invite = async (teamUser: TeamUser) => {

    const response = await fetch(`/api-backend/api/team/invite`, {
        method: "POST",
        headers: {
            "content-type": "application/json;charset=utf-8",
        },
        body: JSON.stringify(teamUser),
        redirect: "manual"
    })

    return isCodeMessage(response)
}